package com.yupi.springbootinit.judge.codesanbox;

import com.yupi.springbootinit.judge.codesanbox.model.ExecuteCondeRequest;
import com.yupi.springbootinit.judge.codesanbox.model.ExecuteCondeResponse;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class CodeSandBoxProxy implements CodeSanBox{

    private final CodeSanBox codeSanBox;

    public CodeSandBoxProxy(CodeSanBox codeSanBox){
        this.codeSanBox=codeSanBox;
    }

    /**
     *
     * @param executeCondeRequest
     * @return
     */
    @Override
    public ExecuteCondeResponse executeCode(ExecuteCondeRequest executeCondeRequest) {
        log.info("代码沙箱请求信息 "+executeCondeRequest.toString());
        ExecuteCondeResponse executeCondeResponse = codeSanBox.executeCode(executeCondeRequest);
        log.info("代码沙箱返回信息 "+executeCondeResponse.toString());
        return executeCondeResponse;
    }
}
